package com.ruoyi.system.enums;

/**
 * 移库状态枚举
 */
public enum WmsTransferStatus {
    // 移库状态定义
    COMPLETED("已移库", "1"),
    PENDING("待移库", "2"),
    CANCELED("作废", "3");

    // 枚举属性
    private final String description;
    private final String code;

    // 构造函数
    WmsTransferStatus(String description, String code) {
        this.description = description;
        this.code = code;
    }

    // 获取描述
    public String getDescription() {
        return description;
    }

    // 获取状态码
    public String getCode() {
        return code;
    }

    // 通过code获取枚举实例
    public static WmsTransferStatus getByCode(String code) {
        for (WmsTransferStatus status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return null;
    }

    // 通过description获取枚举实例
    public static WmsTransferStatus getByDescription(String description) {
        for (WmsTransferStatus status : values()) {
            if (status.description.equals(description)) {
                return status;
            }
        }
        return null;
    }
}